package com.smile.api;

import com.smile.commons.page.R;
import com.smile.model.request.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "smile-plus-standalone-device", contextId = "fly", path = "/api/device")
public interface FlyApi {

    /**
     * 一键飞往目标点
     *
     * @param flyToPointRequest
     * @return
     * @throws Exception
     */
    @PostMapping("/fly/flyToPoint")
    R<Void> flyToPoint(@RequestBody FlyToPointRequest flyToPointRequest) throws Exception;

    @PostMapping("/fly/takeoffToPoint")
    R<Void> takeoffToPoint(@RequestBody TakeOffToPointRequest takeOffToPointRequest) throws Exception;


    @PostMapping("/fly/returnHome")
    R<Void> returnHome(@RequestBody ReturnHomeRequest returnHomeRequest) throws Exception;


    @PostMapping("/live/liveStartPush")
    R<Void> liveStartPush(@RequestBody LiveStartPushRequest liveStartPushRequest) throws Exception;


    @PostMapping("/fly/flightAuthorityGrab")
    R<Void> flightAuthorityGrab(@RequestBody FlightAuthorityGrabRequest flightAuthorityGrabRequest) throws Exception;

    /**
     * 进入指令飞行
     * @param drcModeEnterRequest
     * @return
     * @throws Exception
     */
    @PostMapping("/fly/drcModeEnter")
    R<Void> drcModeEnter(@RequestBody DrcModeEnterRequest drcModeEnterRequest) throws Exception;

    /**
     * 飞行控制
     * @param stickControlRequest
     * @return
     * @throws Exception
     */
    @PostMapping("/fly/stickControl")
    R<Void> stickControl(@RequestBody StickControlRequest stickControlRequest) throws Exception;


    /**
     * 飞行控制
     * @param droneControlRequest
     * @return
     * @throws Exception
     */
    @PostMapping("/fly/droneControl")
    R<Void> droneControl(@RequestBody DroneControlRequest droneControlRequest) throws Exception;

    /**
     * 飞行器急停
     * @param droneEmergencyStopRequest
     * @return
     * @throws Exception
     */
    @PostMapping("/fly/droneEmergencyStop")
    R<Void> droneEmergencyStop(@RequestBody DroneEmergencyStopRequest droneEmergencyStopRequest) throws Exception;


    @PostMapping("/fly/flighttaskUndo")
    R<Void> flighttaskUndo(@RequestBody FlighttaskUndoRequest flighttaskUndoRequest) throws Exception;


    @PostMapping("/live/liveLensChange")
    R<Void> liveLensChange(@RequestBody LiveLensChangeRequest liveLensChangeRequest) throws Exception;


    /**
     * 更新 flyto 目标点
     *
     * @param flyToPointUpdateRequest
     * @return
     * @throws
     */
    @PostMapping("/fly/flyToPointUpdate")
    R<Void> flyToPointUpdate(@RequestBody FlyToPointUpdateRequest flyToPointUpdateRequest) throws Exception;

}
